import dayjs from 'dayjs'
import { getParams } from '@/utils/util'
const app = getApp()

const deviceType = {
    0: '手环',
    1: '燃气报警器',
    2: '跌倒监测守护仪'
}
Page({
    data: {
        staticPrefix: app.globalData.STATIC_PREFIX,
        info: {}
    },
    onLoad(options) {
        const params = getParams(options.params)
        console.log(params)
        this.setData({
            info: {
                ...params,
                dealingDate: params.dealingDate ? dayjs(params.dealingDate).format("YYYY-MM-DD HH:mm:ss") : undefined
            },
            longitude: params.lon,
            latitude: params.lat,
            markers: [{
                longitude: params.lon,
                latitude:  params.lat
            }]
        })
    }
})